mod impls;

#[cfg(feature = "derive")]
pub use maybe_deser_owned_derive as derive_macro;

/// A trait for signifying whether the implemented type is `DeserializeOwned`.
///
/// # Safety
///
/// The implementation must not make a non-deser-owned structure flagged as
/// deser-owned, otherwise code relying on the trait implementation being
/// correct could possibly create dangling references.
pub unsafe trait MaybeDeserOwned {
    const IS_DESER_OWNED: bool;
}

/// A trait for signifying whether a specific value (or variant) of the
/// implemented type is `DeserializeOwned`.
///
/// # Safety
///
/// The implementation must not make a non-deser-owned structure flagged as
/// deser-owned, otherwise code relying on the trait implementation being
/// correct could possibly create dangling references.
pub unsafe trait VariantMaybeDeserOwned {
    fn variant_is_deser_owned(&self) -> bool;
}
